home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
ead
/
ead15.dms
/
ead15.adf
/
Listati
/
Oops!.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-05-06
|
3KB
|
101 lines
/* *************************************************************************
Programma ...... Oops!
Versione ....... 1.00i - (7/8/1987...6/5/1989)
Autori ......... Magic Ceee (Joerg Anslik)
Scopo .......... Modificare il colore del Workbench a striscie
Software ....... Aztec C V3.6a || Lattice C V5.02
Hardware ....... Amiga 512K, Kickstart V1.2
Compilazione ... cc +C +D +L Oops! -- ln oops!.o cl32.lib
Note ........... Debug, traduzione ed adattamento di Luigi Callegari
************************************************************************ */
#include "exec/types.h"
#include "exec/memory.h"
#include "graphics/gfxbase.h"
#include "graphics/copper.h"
#include "graphics/gfxmacros.h"
#include "hardware/custom.h"
#include "intuition/intuition.h"
#ifdef LATTICE
#include <string.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <proto/intuition.h>
#else
#include <functions.h>
#endif
#define NO_INTUI "Intuition non si apre!\n"
#define NO_GFX "Graphics non si apre!\n"
struct IntuitionBase *IntuitionBase;
struct GfxBase *GfxBase;
struct ViewPort *MagicView;
struct UCopList *MagicList;
extern struct Custom custom;
/*
y[] = Posizione verticale del pennello di scansione elettronica video
col[] = Tabella dei colori: inizia da $000 (nero), finisce $FFF (blu)
********************************************************************* */
static int pos[] = { 0,12,18,24,30,36,42,48,54,60,66,72,78,84,90,96,102,108,
114,120,126,132,138,144,150,156,162,168,174,180,188,194 };
static int col[] = { 0x000,0x001,0x002,0x003,0x004,0x005,0x006,0x007,0x008,
0x009,0x00a,0x00b,0x00c,0x00d,0x00e,0x00f,0x00f,0x00e,
0x00d,0x00c,0x00b,0x00a,0x009,0x008,0x007,0x006,0x005,
0x004,0x003,0x002,0x001,0x000 };
void _main()
{
register int i;
if(!(IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",0)))
{
Write(Output(),NO_INTUI,strlen(NO_INTUI));
_exit( 10L );
}
if(!(GfxBase=(struct GfxBase *)OpenLibrary("graphics.library",0)))
{
Write(Output(),NO_GFX,strlen(NO_GFX));
CloseLibrary((struct Library *)IntuitionBase);
_exit( 11L );
}
MagicView = GfxBase -> ActiView->ViewPort; /* ViewPort corrente*/
MagicList =(struct UCopList *)AllocMem(sizeof(struct UCopList),\
MEMF_PUBLIC|MEMF_CLEAR);
/* Il seguente ciclo aggiusta la tabella per i modelli PAL
purche' il fondo dello schermo sia nero */
/*
for ( i = 0 ; i < 31 ; i++ )
pos[ i ] += 30;
*/
for( i = 0; i < 31; i++ )
{
CWAIT(MagicList,pos[i],0); /* Attende sino pos[i] */
CMOVE(MagicList,custom.color[0],col[i]);/* Usa nuovo colore */
}
CEND(MagicList); /* Installata nuova UCopList */
MagicView -> UCopIns = MagicList; /* Informa Copper della nuova lista */
RethinkDisplay();
CloseLibrary((struct Library *)IntuitionBase);
CloseLibrary((struct Library *)GfxBase);
_exit( 0L );
}
/* ********************************* E O F ************************** */